<?php

require_once($WSC->get_site_inc_dir().'modules/tangra_cms/pages/vpage/vpt/vpage_manage_wp_abs.class.php');
require_once($WSC->get_site_inc_dir().'modules/tangra_cms/classes/category/tcms_category_dbc.class.php');


class VPage_Man_News_List_WP extends VPage_Manage_WP_Abs {
	protected function _manage() {
		$vpage = $this->get_vpage();

		$category_hid = $this->load_system_attribute('category_hid');
		if ($category_hid) {
			$category = new TCMS_Category_DBC();
			$dbc = $this->get_dbc();
			if ($category->load_by_hid($dbc, $category_hid->get_value())) {
				$this->export('category_sel', $category);
				$this->export('can_go_online', 1);
			}
		}

		$items_per_page = $this->load_system_attribute('items_per_page');
		$this->export('items_per_page', $items_per_page);

		$template = $this->get_vpage_template();
		$items_vpt_sa = new TCMS_VPT_System_Attribute_DBC();
		$dbc = $this->get_dbc();
		if ($items_vpt_sa->load_by_template_and_export_name($dbc, $template->get_id(), 'items_per_page')) {
			$this->export('default_items_per_page', $items_vpt_sa->get_default_value());
		}


		$view = $this->get_view('default');

		return $view;
	}


}